package com.sky.Encapsulation;

public class Student {
    private double score;

    public void SetScore(double score){
        if(score >= 0 && score <= 100){
            this.score = score;
        }else{
            System.out.println("您输入的数据非法");
        }
    }

    public double GetScore(){
        return this.score;
    }

    public void PrintPass(){
        System.out.println(score > 60 ? "成绩合格" : "成绩不合格");
    }
}
